package org.liurq.activemq.comsumer;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class SimpleConsumer {

    @JmsListener(destination = "liurq.queue.simple01")
    public void queueConsumer(String msg) {
        System.out.println("消费 liurq.queue.simple01 :" + msg);
    }

    @JmsListener(destination = "liurq.queue.simple02")
    public void queueConsumer02(String msg) {
        System.out.println("消费 liurq.queue.simple02 :" + msg);
    }


    @JmsListener(destination = "liurq.topic.simple")
    public void topicConsumer01(String msg) {
        System.out.println("topicConsumer01 消费 liurq.topic.simple :" + msg);
    }

    @JmsListener(destination = "liurq.topic.simple")
    public void topicConsumer02(String msg) {
        System.out.println("topicConsumer02 消费 liurq.topic.simple :" + msg);
    }

    @JmsListener(destination = "liurq.topic.simple",containerFactory = "jmsTopicListener")
    public void topicPresistentConsumer03(String msg) {
        System.out.println("topicPresistentConsumer03 持久化消费 liurq.topic.simple :" + msg);
    }
}
